package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.user.marketingtag.MarketingTagQuery;
import com.uzai.console.entity.MarketingTag;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface MarketingTagMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    int insert(MarketingTag record);

    int insertSelective(MarketingTag record);

    MarketingTag selectById(@Param("id") Long id, @Param("merId") Long merId);

    //验证重名
    MarketingTag selectByName(@Param("merId") Long merId, @Param("name") String name);

    int updateByIdSelective(MarketingTag record);

    int updateById(MarketingTag record);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<MarketingTag> findByList(Page<MarketingTag> page, @Param("query") MarketingTagQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<MarketingTag> findByList(@Param("query") MarketingTagQuery query);
}